<?php
	require_once('database.php');
	require_once('display_functions.php');
	$id = $_POST['id'];
	$tog = $_POST['complete'];
	$userid = $_POST['user'];
	$proj = (isset($_POST['project']) ? $_POST['project'] : 0);
	setTaskCompleted($id, $tog);
	echo("$tog\n\t\t\n");
	printFullTaskList($userid, 'cs147organizer.db', ($tog == 1 ? 1 : 0), $proj, ($tog == 1 ? true:false), ($tog == 1 ? 'DESC' : 'ASC'));
?>